<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Admin extends Model
{
    use SoftDeletes;
    protected $table = 'users';
    protected $fillable = ['unique_id'];


    public function getCityNameAttribute()
    {
        $cid = (int) $this->city_id;
        if ($cid) {
            $city = '';
        }

    }
    public function getProvinceNameAttribute()
    {

    }
    public function getRegionNameAttribute()
    {

    }
    public function getStatusNameAttribute()
    {

    }

    public function getDistributorIdAttribute()
    {
        return $this->creator_id;
    }
    public function getDistributorNameAttribute()
    {

    }

    public function distributor()
    {
        return $this->belongsTo('App\Models\Admin', 'creator_id');
    }
    public function dealers()
    {
        return $this->hasMany('App\Models\Admin', 'creator_id');
    }


}
